package com.robam.cloud.authcenter.helper;

import com.alibaba.fastjson.JSONObject;
import com.robam.cloud.common.bean.authcenter.dto.FaceParam;
import com.robam.cloud.common.bean.authcenter.entity.AuthPlatform;
import com.robam.cloud.common.bean.authcenter.entity.FaceRes;
import com.robam.cloud.common.bean.usercenter.entity.UserSession;

import javax.servlet.http.HttpServletRequest;

public abstract class ThirdAuthGateway {
    /**
     * 三方认证返回用户信息
     *
     * @param request
     * @return
     */
    public abstract UserSession getUserSession(AuthPlatform authPlatform, JSONObject request, HttpServletRequest httpServletRequest);

    /**
     * redis每次更新存入token：facebizNo（当前是最新bizNo）
     * 初始化facebizNo：false 前端需要自己保存好本次业务需要的bizNo
     * 真正业务提交携带List<faceBizNo>逐一验Ture
     * 主要考虑一单业务多人扫脸的情况
     *
     * @param authPlatform
     * @param certNo
     * @param certType
     * @param certName
     * @param sfbr
     * @param expireTime
     * @param token
     * @return
     */
    public abstract FaceParam getFaceParam(AuthPlatform authPlatform, String certNo, String certType, String certName, String sfbr, String expireTime, String token);

    public abstract void verifyFaceResult(AuthPlatform authPlatform, FaceRes faceRes, String token);

    public abstract String getMediaUrl(AuthPlatform authPlatform, String serverId);
}
